package com.ruoyi.system.service.impl;

import java.util.List;
import java.util.Map;

import com.ruoyi.common.annotation.DataScope;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.WxInfoMapper;
import com.ruoyi.system.domain.WxInfo;
import com.ruoyi.system.service.IWxInfoService;
import com.ruoyi.common.core.text.Convert;

/**
 * infoService业务层处理
 *
 * @author ruoyi
 * @date 2021-07-31
 */
@Service
public class WxInfoServiceImpl implements IWxInfoService
{
    @Autowired
    private WxInfoMapper wxInfoMapper;

    @Override
    public List<WxInfo> selectWxInfoLists(Map map) {
        return wxInfoMapper.selectWxInfoLists(map);
    }

    @Override
    public List<WxInfo> selectWxInfoByOpenId(WxInfo wxInfo) {
        return wxInfoMapper.selectWxInfoByOpenId(wxInfo);
    }

    /**
     * 查询info
     *
     * @param id infoID
     * @return info
     */
    @Override
    public WxInfo selectWxInfoById(Long id)
    {
        return wxInfoMapper.selectWxInfoById(id);
    }

    @Override
    @DataScope(deptAlias = "d", userAlias = "u")
    public List<WxInfo> selectWxInfoListForCheck(WxInfo wxInfo) {
        return wxInfoMapper.selectWxInfoListForCheck(wxInfo);
    }

    /**
     * 查询info列表
     *
     * @param wxInfo info
     * @return info
     */
    @Override
    @DataScope(deptAlias = "d", userAlias = "u")
    public List<WxInfo> selectWxInfoList(WxInfo wxInfo)
    {
        return wxInfoMapper.selectWxInfoList(wxInfo);
    }

    /**
     * 新增info
     *
     * @param wxInfo info
     * @return 结果
     */
    @Override
    public int insertWxInfo(WxInfo wxInfo)
    {
        wxInfo.setCreateTime(DateUtils.getNowDate());
        return wxInfoMapper.insertWxInfo(wxInfo);
    }

    /**
     * 修改info
     *
     * @param wxInfo info
     * @return 结果
     */
    @Override
    public int updateWxInfo(WxInfo wxInfo)
    {
        return wxInfoMapper.updateWxInfo(wxInfo);
    }

    /**
     * 删除info对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteWxInfoByIds(String ids)
    {
        return wxInfoMapper.deleteWxInfoByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除info信息
     *
     * @param id infoID
     * @return 结果
     */
    @Override
    public int deleteWxInfoById(Long id)
    {
        return wxInfoMapper.deleteWxInfoById(id);
    }
}
